package io.io2;

import java.io.*;
import java.nio.charset.StandardCharsets;

/**
 * 使用转换流来读取
 */
public class ISRDemo {
    public static void main(String[] args) throws IOException {
        File file=new File("osw.txt");
        FileInputStream fis=new FileInputStream(file);
        InputStreamReader ois=new InputStreamReader(fis, StandardCharsets.UTF_8);
        int d;
        while ((d=ois.read())!=-1){
            System.out.print((char)d);
        }
        ois.close();
    }
}
